1. Field of the Invention
The present invention relates generally to a method of editing rules in a template-based tree-structure environment. In an exemplary embodiment, the present invention is incorporated in an XSLT (eXtensible Style Language Transformations) stylesheet editor to automatically propose options for XSLT stylesheet rule modifications as based on selections by a user of stylesheet rules and eXtensible Mark-up Language (XML) source elements.
2. Description of the Related Art
FIG. 1 shows an overview of a conventional method of editing an XSLT stylesheet. XSLT stylesheet 10 includes a set of rules that describe how to process elements of an input XML document 11 to transform these elements into XML output document 12. The actual transformation is executed by transformation engine 13 which is typically an XML application that often additionally includes an XML parser (see FIG. 2 for parser 14). Each rule of the stylesheet 10 matches one or more elements in the input document and describes the actions to take and the output to produce when a matching element is found.
An XSLT stylesheet transforms “source XML” to “result XML”. The structure and content of the result are determined by the source as interpreted, sampled, or elaborated by the stylesheet.
Source-1 + Stylesheet ==> Result-1Source-2 + Stylesheet ==> Result-2
An XML document contains elements, attributes, and text. A stylesheet contains rules. Rules match elements, attributes, and/or text in the source. When a rule matches, it executes in context of the matched source. It produces some result XML influenced by that context.
XML may be represented as a “tree” of “nodes.” Each node of the tree is an element or text. The node at the top of the tree is the “root.” All of the nodes connected to the root are the “children” of the root, which is their “parent.”

An XSLT stylesheet is itself written as XML. Each rule in the stylesheet is a node in a tree.

Each rule is applicable whenever processing reaches an input XML node that matches its “match condition”. Default rules are defined by the environment such that all nodes are matched. Match conditions of XSLT are expressed in the W3C XPath standard language.
An XSLT stylesheet program expresses directly how an input XML document is transformed into an output XML document for presentation or further processing. The major task in developing XSLT stylesheets is structuring the stylesheet into rules that fit the input data to be processed.
Thus, an XSLT stylesheet expresses the transformation rules for converting source XML into a result XML for presentation or further processing. Execution of an XSLT stylesheet is non-sequential. It is not like a program written in conventional programming languages such as C, C++, Java, Basic, FORTRAN, Cobol, etc. This makes the development of XSLT stylesheets very different from development of XML processing programs in conventional programming languages such as C, C++, Java, or Visual Basic. It has a very different execution paradigm than that of these sequential-based structures to which they are accustomed. This means that tools for understanding execution of an XSLT stylesheet can be very different than similar tools for sequential programming languages, such as “debuggers.”
When developing an XSLT stylesheet, users need to take the following issues into consideration: What input structure should my new rule match?How do I ensure that the rule I am creating is applied to just the nodes I want? If I create a new rule will it prevent an existing rule that I still want applied from being applied? How do I ensure that I do not end up with many redundant rules?
These issues make stylesheet development tedious. The editors of the convention methods fail to provide adequate assistance in developing new rules of an XSLT stylesheet.